package JSE_02.Map.Demo03;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo03 {
    public static void main(String[] args){
        Map<String,Integer> map00=new HashMap<>();
        map00.put("小红",19);
        map00.put("小美",30);
        map00.put("小婷",28);
        Set<Map.Entry<String,Integer>> set=map00.entrySet();

        Iterator<Map.Entry<String,Integer>> it=set.iterator();
        while(it.hasNext()){
            Map.Entry<String,Integer> en=it.next();
            System.out.println(en.getKey()+"="+en.getValue());
        }

        System.out.println("================");
        for(Map.Entry<String,Integer> entry:set){
            System.out.println(entry.getKey());
            System.out.println(entry.getValue());
        }

    }
}
